package gui.model;

import java.util.ArrayList;
import java.util.List;
 
import javax.swing.ComboBoxModel;
import javax.swing.event.ListDataListener;
 
import dao.CategoryDAO;
import dao.RecordDAO;
import entity.Category;
import entity.Record;
import gui.panel.CategoryPanel;
import gui.panel.SearchPanel;
import service.CategoryService;
import service.CheckService;
 
public class CheckComboBoxModel implements ComboBoxModel<Integer>{
   public Category c;
   public List<Integer> number=new ArrayList<>();
    public int num;
    
    public CheckComboBoxModel() {
        c=CategoryPanel.instance.getSelectedCategory();
     
        for(int i=0;i<c.recordNumber;i++) {
          number.add(0);
        }
         num=SearchPanel.instance.t.getSelectedRow();
         
    }
    @Override
    public void addListDataListener(ListDataListener arg0) {
        // TODO Auto-generated method stub
         
    }
 
    @Override
    public Integer getElementAt(int arg0) {
        // TODO Auto-generated method stub
        return number.get(arg0);
    }
 
    @Override
    public int getSize() {
        // TODO Auto-generated method stub
        return number.size();
    }
 
    @Override
    public void removeListDataListener(ListDataListener arg0) {
        // TODO Auto-generated method stub
         
    }
 
    @Override
    public Object getSelectedItem() {
        // TODO Auto-generated method stub
        return num;
    }
 
    @Override
    public void setSelectedItem(Object arg0) {
        // TODO Auto-generated method stub
        num=(int)arg0;
    }
     
 
}